
import hanle from './index'
const defaultstore = {
    ...hanle.state
}
let reducer = (state = defaultstore, action: { type: string }) => {
    let newstate = JSON.parse(JSON.stringify(state))
    for (let key in hanle.actions) {
      if (action.type===key) {
        hanle.actions[key](newstate,action)
        }
    }
    return newstate
}
export default reducer

// import { Action } from '@remix-run/router'
// import handlearr from './index'
// const defaultstore = {
//     ...handlearr.state
// }
// let reducer = (state = defaultstore, action: { type: string, val: number }) => {
//     let newstate = JSON.parse(JSON.stringify(state))
//     switch (action.type) {
//         case handlearr.arrpush:
//             handlearr.actions[handlearr.arrpush](newstate,action)
//             break;
//         default:
//             break;
//     }
//     return newstate
// }

// export default reducer